<template>
	<view>
		<view class="contentBox">
			<view class="title">
			   基础信息
			</view>
			<view class="infoItem f-c-sb">
				<text class="label">任务名称</text>
				<text>{{taskInfo.taskName}}</text>
			</view>
			<view class="infoItem f-c-sb">
				<text class="label">推广类型</text>
				<text>{{taskInfo.activityType|activityType}}</text>
			</view>
			<view class="infoItem f-c-sb">
				<text class="label">任务开始时间</text>
				<text>{{taskInfo.taskStartTime}}</text>
			</view>
			<view class="infoItem f-c-sb">
				<text class="label">任务结束时间</text>
				<text>{{taskInfo.taskEndTime}}</text>
			</view>
			
		</view>
		<view class="contentBox" style="margin-top: 10rpx;">
			<view class="title">
			   推广指标
			</view>
			<view class="infoItem f-c-sb">
				<text class="label">线索留资</text>
				<text>{{taskInfo.numberOfClue}}条</text>
			</view>
			<view class="infoItem f-c-sb">
				<text class="label">分享次数</text>
				<text>{{taskInfo.numberOfSharing}}次</text>
			</view>
			<view class="infoItem f-c-sb">
				<text class="label">任访客数</text>
				<text>{{taskInfo.numberOfVisitors}}人</text>
			</view>
			<view class="infoItem f-c-sb">
				<text class="label">访问次数</text>
				<text>{{taskInfo.numberOfVisits}}次</text>
			</view>
			<view class="infoItem f-c-sb">
				<text class="label">成交单数</text>
				<text>{{taskInfo.numberOfOrders}}单</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		promotionTaskInfo
	} from "@/api/marketingB-helper.js"
	export default {
		data() {
			return {
				taskId : '',
				taskInfo : {}
			}
		},
		onLoad(option) {
			if (option.param) {
				this.taskId = JSON.parse(option.param).taskId
				this.getTaskInfo();
			}
		},
		methods: {
           getTaskInfo() {
			   promotionTaskInfo(this.taskId).then(res=> {
				   this.taskInfo = res.data;
			   })
		   }
		}
	}
</script>

<style lang="scss" scoped>
	.title {
		color: #333;
		font-size: 30rpx;
		font-weight: bold;
		position: relative;
		&::before {
			content: '';
			display: inline-block;
			width: 6rpx;
			height: 26rpx;
			background-color: #177fff;
			margin-right: 10rpx;
		}
	}
	.infoItem {
		margin: 20rpx;
		
	}
	.infoItem .label{
		min-width: 150rpx;
	}
</style>